using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities.Auditing;
using Abp.Domain.Entities;

namespace Dyan.PlatformSystem.Customers
{
    [Table("CustomerBaseInfos")]
    public class CustomerBaseInfo : Entity<Guid>, IMustHaveTenant
    {
        public int TenantId { get; set; }


        [StringLength(CustomerBaseInfoConsts.MaxNameLength, MinimumLength = CustomerBaseInfoConsts.MinNameLength)]
        public virtual string Name { get; set; }

        [StringLength(CustomerBaseInfoConsts.MaxPhoneNumLength, MinimumLength = CustomerBaseInfoConsts.MinPhoneNumLength)]
        public virtual string PhoneNum { get; set; }

        [StringLength(CustomerBaseInfoConsts.MaxEmailLength, MinimumLength = CustomerBaseInfoConsts.MinEmailLength)]
        public virtual string Email { get; set; }

        [StringLength(CustomerBaseInfoConsts.MaxCompanyLength, MinimumLength = CustomerBaseInfoConsts.MinCompanyLength)]
        public virtual string Company { get; set; }

        [StringLength(CustomerBaseInfoConsts.MaxAddressLength, MinimumLength = CustomerBaseInfoConsts.MinAddressLength)]
        public virtual string Address { get; set; }

        [StringLength(CustomerBaseInfoConsts.MaxSexLength, MinimumLength = CustomerBaseInfoConsts.MinSexLength)]
        public virtual string Sex { get; set; }

        [Range(CustomerBaseInfoConsts.MinAgeValue, CustomerBaseInfoConsts.MaxAgeValue)]
        public virtual int Age { get; set; }

        public virtual Guid? CustomerAccountId { get; set; }
        [ForeignKey("CustomerAccountId")]
        public CustomerAccount CustomerAccountFk { get; set; }
    }
}